//package recyclerview.lunbo.lunbo;
//
//import android.content.Context;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.RelativeLayout;
//
//import com.facebook.drawee.view.SimpleDraweeView;
//import com.jiemian.news.R;
//import com.jiemian.news.bean.NewsItemVo;
//import com.jiemian.news.common.CommontUtil;
//import com.jiemian.news.module.wozai.view.carouseview.CarouselPagerAdapter;
//import com.jiemian.news.module.wozai.view.carouseview.CarouselViewPager;
//import com.jiemian.news.utils.SetUtils;
//import com.jiemian.news.utils.fresco.FrescoUtils;
//
//import java.util.List;
//
///**
// * Created by hy on 2015/8/17.
// */
//public class LunboAdapter extends CarouselPagerAdapter implements View.OnClickListener {
//    private List<NewsItemVo> listLunbo;
//    private Context mContext;
//    public static final String LUNBO_TYPE="lunbo_type";
//    private SimpleDraweeView iv_img;
//    private ImageView iv_shadow;
//    private onViewPagerClickListener listener;
//    private int width;
//    public LunboAdapter(CarouselViewPager viewPager, List<NewsItemVo> list, Context context){
//        super(viewPager);
//        this.listLunbo=list;
//        mContext=context;
//        width= CommontUtil.getScreenWidth();
//    }
//    @Override
//    public void onClick(View v) {
//        int id=(Integer)v.getTag(R.id.lunbo_postion);
//        String type = (String) v.getTag(R.id.lunbo_type);
//        if(id>=listLunbo.size()){
//            return ;
//        }
//        NewsItemVo news=listLunbo.get(id);
//        if(news==null){
//            return;
//        }
//        //fm1.onItemClickAll(news);
//        if(this.listener != null)
//            this.listener.onViewPagerItemClick(news,type);
//    }
//
//    public void setOnViewPagerClickListener(onViewPagerClickListener listener){
//        this.listener = listener;
//    }
//
//    @Override
//    public int getRealDataCount() {
//        return listLunbo.size();
//    }
//
//    @Override
//    public Object instantiateRealItem(ViewGroup container, int position) {
//        View view= View.inflate(mContext,R.layout.jm_lunbo_img,null);
//        iv_img= (SimpleDraweeView) view.findViewById(R.id.iv_lunbo_bg);
//        iv_shadow= (ImageView) view.findViewById(R.id.iv_lunbo_shadow);
//        iv_img.setTag(R.id.lunbo_postion,position);
//        iv_img.setTag(R.id.lunbo_type,LUNBO_TYPE);
//        iv_img.setOnClickListener(this);
//        RelativeLayout.LayoutParams params= (RelativeLayout.LayoutParams) iv_img.getLayoutParams();
//        params.height=(width/16)*9;
//        iv_img.setLayoutParams(params);
//        if(SetUtils.getInstance().isDisplayImg()) {
//            FrescoUtils.getInstance().showImage(iv_img, listLunbo.get(position).getO_image(), R.mipmap.iv_lunbo_defalut);
//        }else{
//            FrescoUtils.getInstance().showImageResource(iv_img, R.mipmap.feed_cell_photo_default_big);
//        }
//        if(NewsItemVo.I_TYPE_VIDEO.equals(listLunbo.get(position).getI_type())){
//            if ("carousel_audiovideo".equals(listLunbo.get(position).getChannelType())) {
//                view.findViewById(R.id.iv_lunbo_video).setVisibility(View.GONE);
//            } else {
//                view.findViewById(R.id.iv_lunbo_video).setVisibility(View.VISIBLE);
//            }
//        }else{
//            view.findViewById(R.id.iv_lunbo_video).setVisibility(View.GONE);
//        }
//        container.addView(view);
//        return view;
//    }
//
//    public interface onViewPagerClickListener{
//         void onViewPagerItemClick(NewsItemVo vo, String type);
//    }
//}
